/**
 * Created by ospip on 2017/10/17.
 * Copyright (c) 2017 LLAP. All rights reserved.
 */

import java.util.Scanner;

public class Keywords {
//    String[] list = {"abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "default", "do", "double", "else", "enum", "extends", "final", "finally", "float", "for", "goto", "if", "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "package", "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "void", "volatile", "while"};
    String[] list = {"void", "double", "switch", "enum", "goto", "catch", "class", "abstract", "long", "short", "extends", "throw", "int", "volatile", "finally", "while", "return", "protected", "implements", "super", "for", "package", "continue", "default", "synchronized", "do", "public", "case", "break", "final", "strictfp", "char", "static", "try", "const", "float", "assert", "throws", "byte", "transient", "private", "boolean", "else", "new", "instanceof", "import", "this", "if", "native", "interface"};
    public Keywords() {
        this.qsort(0, list.length - 1);
    }

    private void qsort(int left, int right) {
        if (left > right) return;
        String temp, t;
        temp = list[left];
        int i = left, j = right;
        while (i != j) {
            while (list[j].compareTo(temp) >= 0 && i < j) --j;
            while (list[i].compareTo(temp) <= 0 && i < j) ++i;
            if (i < j) {
                t = list[i];
                list[i] = list[j];
                list[j] = t;
            }
        }
        list[left] = list[i];
        list[i] = temp;
        qsort(left, i - 1);
        qsort(i + 1, right);
    }

    public int search(String needle, int left, int right) {
        if (left > right) return -1;
        int ret = (left + right) / 2;
        int cmp = list[ret].compareTo(needle);
        if (cmp == 0) return ret;
        if (cmp > 0) return search(needle, left, ret - 1);
        return search(needle, ret + 1, right);
    }
    public int search(String n) { return this.search(n, 0, list.length - 1); }

    @Override
    public String toString() {
        String ret = "Keywords{\n";
        for (String i : list) ret += "    " + i + ", \n";
        ret += "}";
        return ret;
    }

    public static void main(String[] args) {
        Keywords k = new Keywords();
        System.out.println(k);
        Scanner in = new Scanner(System.in);
        while(true) {
            System.out.println(k.search(in.nextLine()));
        }
    }
}
